@extends('layouts.app')

@section('content')
<div class="container">


<div class="row">
<p><a class="btn btn-primary" href="{{ route('books.create') }}" role="button">{{ __('Add Book') }}</a></p>
</div>

    <div class="row">

<ul class="list-unstyled booklist">

	@foreach ($books as $book)
		<li class="media">
		    <a title="edit the chapter of {{ $book->name }}" href="{{ route('book_chapter.index',['book'=>$book->id]) }}"><img class="mr-3" src="{{ $book->cover }}" style="width:100px;" alt="Generic placeholder image"></a>
		    <div class="media-body">
		      <h5 class="mt-0 mb-1"><a href="{{ route('books.edit',['book'=>$book->id]) }}">{{ $book->name }}</a></h5>
		      {{ $book->description }}
		    </div>
		</li>        
    @endforeach
  
</ul>

    </div>

    {{ $books->links('vendor.pagination.bootstrap-4') }}

</div>
@endsection
